﻿using System;
using System.Collections.Generic;
using System.Text;

namespace NP.BPMReportPlatform.Utils
{
    public class BPMUtilsAppService : BPMReportPlatformAppService, IBPMUtilsAppService
    {

        /// <summary>
        /// 获取流程查看页面的地址
        /// </summary>
        /// <param name="instanceNumber">流程实例编号</param>
        /// <param name="userId">有权限查看的人员格式 （a,b,c 未进行测试）</param>
        /// <returns></returns>
        public string GetProcessUrl(string instanceNumber, string userId)
        {
            var _pcUrlTemplate = ConfigManager.PcUrlTemplate;
            var _tokenTimeout = ConfigManager.TokenTimeout;

            var pUrl = string.Format(_pcUrlTemplate, instanceNumber) + $"?token={MT.Enterprise.Utils.Crypto.JwtEncrypt($"{instanceNumber}|{userId}", _tokenTimeout)}";
            return pUrl;
        }

    }
}
